package com.purong.purong.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.purong.purong.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wenjiezeng on 2017/11/2.
 */
public class BankLoanMaterAdapter extends RecyclerView.Adapter<BankLoanMaterAdapter.ViewHolder> {
    private List<String> conditionList=new ArrayList<>();
    private Context mContext;
    public BankLoanMaterAdapter(Context context){
        this.mContext=context;
    }
    public void setData(List<String> List) {

        this.conditionList = List;
    }
    @Override
    public BankLoanMaterAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View v = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.bank_loan_condition_item, parent, false);
        // set the view's size, margins, paddings and item_circle parameters
        ViewHolder vh = new ViewHolder(v);

        return vh;
    }

    @Override
    public void onBindViewHolder(BankLoanMaterAdapter.ViewHolder holder, int position) {
        holder.content.setText((position+1)+")."+conditionList.get(position));

    }
    public class ViewHolder extends RecyclerView.ViewHolder {
        //绑定每个CircleItem的控件引用到ViewHolder
        private TextView content;
        public ViewHolder(View v) {
            super(v);

            content=(TextView)v.findViewById(R.id.content);
        }
    }
    @Override
    public int getItemCount() {
        return conditionList.size();
    }
}
